Package org.battlestar.engine

Source Code of org.battlestar.engine.MyFourthTest

package org.battlestar.engine;

import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
import com.google.appengine.tools.development.testing.LocalUserServiceTestConfig;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

/**
*  To test Google user Authority.
* @author David Qi
*
*/
public class MyFourthTest {
    private final LocalServiceTestHelper helper =
            new LocalServiceTestHelper(new LocalUserServiceTestConfig())
                .setEnvIsAdmin(true).setEnvIsLoggedIn(true);

        @Before
        public void setUp() {
            helper.setUp();
        }

        @After
        public void tearDown() {
            helper.tearDown();
        }

        @Test
        public void testIsAdmin() {
            UserService userService = UserServiceFactory.getUserService();
            assertTrue(userService.isUserAdmin());
        }
}
TOP

Related Classes of org.battlestar.engine.MyFourthTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.